<template>
  <ve-wordcloud
    :data="chartData"
    :settings="chartSettings"
    height="100%"
  />
</template>

<script>
import { wordCloud } from '@/api/axiosHttp'

export default {
  data () {
    return {
      wordCloudData: [],
      chartSettings: {
        color: ['rgba(97,216,0,.7)', 'rgba(204,178,26,.7)', 'rgba(245,166,35,.7)', 'rgba(156,13,113,.7)']
      }
    }
  },
  computed: {
    chartData () {
      return {
        columns: ['word', 'count'],
        rows: this.wordCloudData
      }
    }
  },
  created () {
    wordCloud().then(data => {
      this.wordCloudData = data
    })
  }
}

</script>
